package com.tbit.main.service.impl;

import com.tbit.main.constant.DaoParamConstant;
import com.tbit.main.dao.log.UserRefundLogDao;
import com.tbit.main.pojo.UserRefundOrderSta;
import com.tbit.main.service.UserRefundLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 退款日志Service业务层处理
 *
 * @author jing
 * @date 2021-05-26
 */
@Service
@Slf4j
public class UserRefundLogServiceImpl implements UserRefundLogService {
    @Autowired
    private UserRefundLogDao userRefundLogDao;


    @Override
    public UserRefundOrderSta staByTime(Integer accountId, String startTime, String endTime) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(DaoParamConstant.accountId, accountId);
        params.put(DaoParamConstant.startTime, startTime);
        params.put(DaoParamConstant.endTime, endTime);
        return userRefundLogDao.staByTime(params);
    }

    @Override
    public Map<String, Object> getByAccountId(Integer accountId, String startDate, String endDate) {
        Map<String, Object> map = new HashMap<>();
        map.put(DaoParamConstant.accountId, accountId);
        map.put("startDate", startDate);
        map.put("endDate", endDate);
        return userRefundLogDao.getByAccountId(map);
    }

}
